export const calcColumns = (params?) => {
  const columns = [
    {
      title: "ID",
      hidden: process.env.UMI_ENV == "prod" ? true : false,
      dataIndex: "id",
      hideInSearch: true,
      width: 200,
    },
    {
      title: "消息分类",
      dataIndex: "messageCategory",
      valueEnum: {
        1: { text: "平台消息" },
        2: { text: "服务消息" },
        3: { text: "交易消息" },
      },
    },
    {
      title: "模板标题",
      dataIndex: "messageTemplateName",
      hideInSearch: true,
      ellipsis: true,
    },
    {
      title: "状态",
      dataIndex: "status",
      valueEnum: {
        0: { text: "启用", status: "success" },
        1: { text: "禁用", status: "error" },
      },
    },
  ];
  if (params) {
    const { operate } = params;
    columns.push(...operate);
    return columns;
  } else {
    return columns;
  }
};
export const calcColumns1 = [
  {
    title: "昵称",
    dataIndex: "nickName",
  },
  {
    title: "手机号码",
    dataIndex: "phonenumber",
  },
  {
    title: "所属场馆",
    dataIndex: "venueName",
    hideInSearch: true,
    ellipsis: true,
  },
];
export const calcColumns2 = [
  {
    title: "昵称",
    dataIndex: "nickName",
  },
  {
    title: "手机号码",
    dataIndex: "phoneNumber",
  },
  {
    title: "状态",
    dataIndex: "messageStatus",
    valueEnum: {
      0: { text: "未读", status: "error" },
      1: { text: "已读", status: "success" },
    },
  },
  {
    title: "已读时间",
    dataIndex: "updateTime",
    hideInSearch: true,
    render: (_, record) => {
      return record.updateTime ? record.updateTime : "-";
    },
  },
];
